package cn.woniu.ecommerceplatform.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.redis.core.RedisHash;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

@Data
@AllArgsConstructor
@NoArgsConstructor
@RedisHash("Services")
public class Services {
    @Id
    @TableId
    private Integer id; //售后id
    private String orderNum; //订单编号
    private String goodImg; //商品图片
    private String goodName; //商品名称
    private Double goodPrice; //原价
    private Double deductionAmount; //积分抵扣金额
    private Double discount; //折扣价
    private Integer buyNum; //购买数量
    private Double actualPay; //实际支付金额

    @TableField(value = "end_time")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date endTime; //创建时间
    private Integer status; //售后状态
    @TableField(value = "good_id")
    private Integer goodId; //商品id
    private String userAccount; //用户账号
    private String account; //管理员账号
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date salesTime; //售后完成时间
    private Integer information; //申请售后原因
    private Integer news; //售后结果原因

    private Integer orderId; //订单id
    private Integer serviceId; //售后建议表的外键id

}
